<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/common.css}">
    <link rel="stylesheet" th:href="@{/css/detail.css}">
    <script language="JavaScript">
        function showDelImg(imgId) {
            var obj = document.getElementById(imgId);
            if (obj) {
                obj.style.display = 'inline';
            }

        }

        function hiddenDelImg(imgId) {
            var obj = document.getElementById(imgId);
            if (obj) {
                obj.style.display = 'none';
            }
        }

        function delReply(replyId, topicId) {
            if (window.confirm("是否确认删除？")) {
                window.location.href = 'reply.do?operate=delReply&replyId=' + replyId + '&topicId=' + topicId;
            }
        }
    </script>
</head>
<body>
<div id="div_back_to_topic_list">
    <a th:href="@{|/topic.do?operate=getTopicList&uid=${topic.userBasicBean.id}|}">返回日志列表</a>
</div>
<div id="div_topic_detail">
    <div id="div_topic_info">
        <!-- topic自身信息 -->
        <table id="tbl_topic_info">
            <tr>
                <td rowspan="2" class="w14 h96">
                    <div class="h64 center " style="width:100%;">
                        <img class="img56 " th:src="@{|/imgs/${topic.userBasicBean.headImg}|}"/>
                    </div>
                    <div class="h32 center" style="width:100%;"
                         th:text="${topic.userBasicBean.nickName}">乔峰
                    </div>
                </td>
                <td class="topic_title" onmousemove="showDelImg('img01')"
                    onmouseout="hiddenDelImg('img01')">
                    <img id="img01"
                         style="float: right;margin-top:2px;margin-right:2px;display: none;width:24px;height: 24px;"
                         th:src="@{/imgs/del.jpg}"/>
                    <span th:text="${topic.title}">《萧某今天就和天下群雄决一死战，你们一起上吧！》</span>
                    <span class="title_date_right"
                          th:text="${topic.topicDate}">2021-09-01 12:30:55</span>
                </td>
            </tr>
            <tr>
                <td th:text="${topic.content}">杀母大仇, 岂可当作买卖交易？此仇能报便报, 如不能报, 则我父子毕命于此便了。这等肮脏之事,
                    岂是我萧氏父子所屑为？
                </td>
            </tr>
        </table>
    </div>
    <div id="div_reply_list">
        <table class="tbl_reply_info" th:each="reply : ${topic.repplyList}">
            <tr>
                <td rowspan="2" class="w14 h88">
                    <div class="h56 center" style="width:100%;">
                        <img class="img48" th:src="@{|/imgs/${reply.userBasicBean.headImg}|}"/>
                    </div>
                    <div class="h32 center" style="width:100%;"
                         th:text="${reply.userBasicBean.nickName}">段誉
                    </div>
                </td>
                <td class="reply_title" th:onmouseover="|showDelImg('img${reply.id}')|"
                    th:onmouseout="|hiddenDelImg('img${reply.id}')|">
                    <span th:text="|回复内容：${reply.content}|">萧某今天就和天下群雄决一死战，你们一起上吧！</span>
                    <span class="title_date_right"
                          th:text="${reply.repplyDate}">2021-09-01 14:35:15</span>
                </td>

            </tr>
            <tr>


                <td  th:if="${reply.masterRepplay!=null}">
                    <span th:text="|主人回复：${reply.masterRepplay.content}|"></span>
                </td>

                <td  th:if="${reply.masterRepplay==null}">

                    <form th:action="@{/reply.do}" method="post">
                        <input type="hidden" name="operate" value="addMasterReply">
                        <input type="hidden" name="repplyId" th:value="${reply.id}">
                        <input type="hidden" name="uid" th:value="|${topic.userBasicBean.id}|">
                        <input type="hidden" name="topicId" th:value="|${topic.id}|">
                        <input type="text" name="content">
                        <input type="submit" th:value="主人回复">
                    </form>
                </td>








            </tr>

        </table>
    </div>
</div>
<div id="div_add_reply">
    <p class="add_reply_title">添加回复</p>
    <form action="reply.do" method="post">
        <input type="hidden" name="operate" value="addReply"/>
        <input type="hidden" name="topicId" th:value="${topic.id}"/>
        <table>
            <tr>
                <th style="width: 25%">回复日志：</th>
                <td><input type="text" th:value="|《${topic.title}》|"
                           value="《萧某今天就和天下群雄决一死战，你们一起上吧！》" readonly/></td>
            </tr>
            <tr>
                <th>回复内容1：</th>
                <td><textarea name="content" rows="3">这里是另一个回复！</textarea></td>
            </tr>
            <tr>
                <th colspan="2">
                    <input type="submit" value=" 回 复 "/>
                    <input type="reset" value=" 重 置 "/>
                </th>
            </tr>
        </table>
    </form>
</div>
</body>
</html>
